//
// CPSMultiTexturedParticle.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CPSMultiTexturedParticle {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CPSMultiTexturedParticle(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSMultiTexturedParticle obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSMultiTexturedParticle(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void enableMultiTexture(boolean enabled) {
    nel3dJNI.CPSMultiTexturedParticle_enableMultiTexture__SWIG_0(swigCPtr, this, enabled);
  }

  public void enableMultiTexture() {
    nel3dJNI.CPSMultiTexturedParticle_enableMultiTexture__SWIG_1(swigCPtr, this);
  }

  public boolean isMultiTextureEnabled() {
    return nel3dJNI.CPSMultiTexturedParticle_isMultiTextureEnabled(swigCPtr, this);
  }

  public void setTexture2(ITexture tex) {
    nel3dJNI.CPSMultiTexturedParticle_setTexture2(swigCPtr, this, ITexture.getCPtr(tex), tex);
  }

  public ITexture getTexture2() {
    long cPtr = nel3dJNI.CPSMultiTexturedParticle_getTexture2__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setMainTexOp(CPSMultiTexturedParticle.TOperator op) {
    nel3dJNI.CPSMultiTexturedParticle_setMainTexOp(swigCPtr, this, op.swigValue());
  }

  public CPSMultiTexturedParticle.TOperator getMainTexOp() {
    return CPSMultiTexturedParticle.TOperator.swigToEnum(nel3dJNI.CPSMultiTexturedParticle_getMainTexOp(swigCPtr, this));
  }

  public void enableAlternateTex(boolean enabled) {
    nel3dJNI.CPSMultiTexturedParticle_enableAlternateTex__SWIG_0(swigCPtr, this, enabled);
  }

  public void enableAlternateTex() {
    nel3dJNI.CPSMultiTexturedParticle_enableAlternateTex__SWIG_1(swigCPtr, this);
  }

  public boolean isAlternateTexEnabled() {
    return nel3dJNI.CPSMultiTexturedParticle_isAlternateTexEnabled(swigCPtr, this);
  }

  public void setTexture2Alternate(ITexture tex) {
    nel3dJNI.CPSMultiTexturedParticle_setTexture2Alternate(swigCPtr, this, ITexture.getCPtr(tex), tex);
  }

  public ITexture getTexture2Alternate() {
    long cPtr = nel3dJNI.CPSMultiTexturedParticle_getTexture2Alternate__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setAlternateTexOp(CPSMultiTexturedParticle.TOperator op) {
    nel3dJNI.CPSMultiTexturedParticle_setAlternateTexOp(swigCPtr, this, op.swigValue());
  }

  public CPSMultiTexturedParticle.TOperator getAlternateTexOp() {
    return CPSMultiTexturedParticle.TOperator.swigToEnum(nel3dJNI.CPSMultiTexturedParticle_getAlternateTexOp(swigCPtr, this));
  }

  public void setScrollSpeed(long stage, SWIGTYPE_p_NLMISC__CVector2f sp) {
    nel3dJNI.CPSMultiTexturedParticle_setScrollSpeed(swigCPtr, this, stage, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(sp));
  }

  public SWIGTYPE_p_NLMISC__CVector2f getScrollSpeed(long stage) {
    return new SWIGTYPE_p_NLMISC__CVector2f(nel3dJNI.CPSMultiTexturedParticle_getScrollSpeed(swigCPtr, this, stage), false);
  }

  public void setAlternateScrollSpeed(long stage, SWIGTYPE_p_NLMISC__CVector2f sp) {
    nel3dJNI.CPSMultiTexturedParticle_setAlternateScrollSpeed(swigCPtr, this, stage, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(sp));
  }

  public SWIGTYPE_p_NLMISC__CVector2f getAlternateScrollSpeed(long stage) {
    return new SWIGTYPE_p_NLMISC__CVector2f(nel3dJNI.CPSMultiTexturedParticle_getAlternateScrollSpeed(swigCPtr, this, stage), false);
  }

  public void serialMultiTex(IStream f) {
    nel3dJNI.CPSMultiTexturedParticle_serialMultiTex(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void setupMaterial(ITexture primary, IDriver drv, CMaterial mat, CVertexBuffer vb) {
    nel3dJNI.CPSMultiTexturedParticle_setupMaterial(swigCPtr, this, ITexture.getCPtr(primary), primary, IDriver.getCPtr(drv), drv, CMaterial.getCPtr(mat), mat, CVertexBuffer.getCPtr(vb), vb);
  }

  public static void forceBasicCaps(boolean force) {
    nel3dJNI.CPSMultiTexturedParticle_forceBasicCaps__SWIG_0(force);
  }

  public static void forceBasicCaps() {
    nel3dJNI.CPSMultiTexturedParticle_forceBasicCaps__SWIG_1();
  }

  public static boolean areBasicCapsForced() {
    return nel3dJNI.CPSMultiTexturedParticle_areBasicCapsForced();
  }

  public void setUseLocalDate(boolean use) {
    nel3dJNI.CPSMultiTexturedParticle_setUseLocalDate(swigCPtr, this, use);
  }

  public boolean getUseLocalDate() {
    return nel3dJNI.CPSMultiTexturedParticle_getUseLocalDate(swigCPtr, this);
  }

  public void setUseLocalDateAlt(boolean use) {
    nel3dJNI.CPSMultiTexturedParticle_setUseLocalDateAlt(swigCPtr, this, use);
  }

  public boolean getUseLocalDateAlt() {
    return nel3dJNI.CPSMultiTexturedParticle_getUseLocalDateAlt(swigCPtr, this);
  }

  public void setBumpFactor(float bumpFactor) {
    nel3dJNI.CPSMultiTexturedParticle_setBumpFactor(swigCPtr, this, bumpFactor);
  }

  public float getBumpFactor() {
    return nel3dJNI.CPSMultiTexturedParticle_getBumpFactor(swigCPtr, this);
  }

  public void enumTexs(SWIGTYPE_p_std__vectorT_NLMISC__CSmartPtrT_NL3D__ITexture_t_t dest, IDriver drv) {
    nel3dJNI.CPSMultiTexturedParticle_enumTexs(swigCPtr, this, SWIGTYPE_p_std__vectorT_NLMISC__CSmartPtrT_NL3D__ITexture_t_t.getCPtr(dest), IDriver.getCPtr(drv), drv);
  }

  public final static class TOperator {
    public final static TOperator Add = new TOperator("Add", nel3dJNI.CPSMultiTexturedParticle_Add_get());
    public final static TOperator Modulate = new TOperator("Modulate");
    public final static TOperator Decal = new TOperator("Decal");
    public final static TOperator EnvBumpMap = new TOperator("EnvBumpMap");
    public final static TOperator Last = new TOperator("Last", nel3dJNI.CPSMultiTexturedParticle_Last_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TOperator swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TOperator.class + " with value " + swigValue);
    }

    private TOperator(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TOperator(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TOperator(String swigName, TOperator swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TOperator[] swigValues = { Add, Modulate, Decal, EnvBumpMap, Last };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
